package com.kun.controller;

import com.kun.OrderService;
import com.kun.RpcProxy;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class OrderController {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("services.xml");
        RpcProxy rpcProxy = context.getBean(RpcProxy.class);

        OrderService orderService = rpcProxy.create(OrderService.class);
        String orderNo = orderService.createOrder(666, 20);

        System.out.println("创建订单成功，订单编号为：" + orderNo);
    }
}
